package com.hai.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author NieChangan
 * @since 2022-05-21
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("tb_image")
public class Image extends Model<Image> {

    /**
     * 主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 图片路径
     */
    @TableField("path")
    private String path;

    /**
     * 图片大小
     */
    @TableField("size")
    private Long size;

    /**
     * 图片类型
     */
    @TableField("media_type")
    private String mediaType;

    /**
     * 图片后缀
     */
    @TableField("suffix")
    private String suffix;

    /**
     * 图片高度
     */
    @TableField("height")
    private Integer height;

    /**
     * 图片宽度
     */
    @TableField("width")
    private Integer width;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private LocalDateTime createTime;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
